interface IStringUtils {
  /**
   * 异步替换字符串中的所有匹配项
   * @param regexp 匹配规则
   * @param asyncFn 异步处理函数
   * @returns {Promise<string>} 替换后的字符串
   * @example
   * const str = await useString.asyncReplaceAll(
   *     '15,1,2-3_12--16____________',
   *     /\d+/g,
   *     async (val: string) => {
   *       return 'name' + val;
   *     }
   *   );
   */
  asyncReplaceAll: (
    str: string,
    regexp: string | RegExp,
    asyncFn: string | Function
  ) => Promise<string>;
}

export type { IStringUtils };
